package com.mowh.gof23.creational.patterns.prototype.framework;

import java.util.HashMap;

/**
 * @author mowh1gd
 * @create 2023/10/20 15:35
 */
public class Manager {
    private HashMap showcase = new HashMap();
    public void register(String name, Product proto) {
        showcase.put(name, proto);
    }
    public Product create(String protoName) throws CloneNotSupportedException {
        Product product = (Product) showcase.get(protoName);
        return product.createClone();
    }
}
